﻿@model XXN.Model.ProductModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>RecommendInfo</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/lib/layui/layui.js"></script>
    <script src="~/Scripts/jquery-1.8.0.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
</head>
<body>
    <div>
        @using (Ajax.BeginForm("RecommendInfo", "Product", new AjaxOptions { OnSuccess = "recommendcomp" }))
        {
            
            @Html.HiddenFor(m => m.Pro_id)
        <div class="layui-form-item">
            @Html.Label("推荐位置名称")
            @Html.DropDownListFor(m => m.Rec_id, ViewData["recom"] as List<SelectListItem>)
            @Html.ValidationMessageFor(m => m.Rec_id)
        </div>
            <div>
                <button>提交</button>
            </div>
        }
    </div>
    <script>
        function recommendcomp(re) {
            if (re.success) {
                parent.layui.layer.msg(re.msg);
                parent.layui.$("#onclick").click();
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            } else {
                parent.layui.layer.msg(re.msg);
            }

        }
    </script>
</body>
</html>
